home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 19
/
CD_ASCQ_19_010295.iso
/
dos
/
prg
/
pas
/
swag
/
win_os2.swg
/
0035_Using lzexpand.dll.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-08-25
|
892b
|
33 lines
{
From: mav@dseg.ti.com (Michael Vincze)
>Does anyone know how to use the decompression tool
>incorporated into MS-Windows (lzexpand.dll) in BP7?
Here's an example. Note that you can only do decompression and not
compression :^(
}
function CopyLZ (FileIn, FileOut: PChar): LongInt;
var
HandleIn : Integer;
HandleOut : Integer;
StructIn : TOFStruct;
StructOut : TOFStruct;
ReturnCode: LongInt;
begin
HandleIn := LZOpenFile (FileIn, StructIn, OF_READ);
ReturnCode := LongInt (HandleIn);
if (HandleIn > -1) then
begin
HandleOut := LZOpenFile (FileOut, StructOut, OF_CREATE or OF_WRITE);
ReturnCode := LongInt (HandleOut);
if (HandleOut > -1) then
begin
ReturnCode := LZCopy (HandleIn, HandleOut);
LZClose (HandleOut);
end;
end;
LZClose (HandleIn);
CopyLZ := ReturnCode;
end;